package com.sun.dao;

import com.sun.config.SpringConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import javax.sql.DataSource;

/**
 * @author SunRui
 * @description TODO
 * @date 2024/9/12 15:19
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = {SpringConfig.class})
public class test {
    @Autowired
    UserDao userDao;
    @Autowired
    DataSource dataSource;


    @Test
    public void showUserDao() {
        userDao.getUser();
    }

    @Test
    public void showDataSource() {
        System.out.println(dataSource);
    }
}
